<meta http-equiv="content-Type" content="text/html; charset=utf-8" />
<%@ page import="java.util.Map"%>
<%@ page import="java.util.HashMap"%>
<%@ page import="tn.common.util.CommonUtil" %>
<%
	Map<String, String> map = new HashMap<String, String>();
	
	map.put("abc", "abc");
	map.put("abc_def", "abc_def");
	map.put("abcDef", "abcDef");
	
	CommonUtil util = new CommonUtil();
	
	String formStr = util.mapToStringKeyValue(map);
%>
<html>
<script type="text/javascript" src="D:\dev\workspace\tn-util\TUtil\html\js\lib\jquery-1.11.1.js"></script>
<script type="text/javascript">
	$(document).ready(function(){
		fnSetFormValue();
	});
	
	// pin data의 value를 form에 셋팅(key, id로 매칭)
	fnSetFormValue = function(){
		var formStr = {<%=formStr%>};
		
		$.each($("#form").serializeArray(), function(idx, field){
			var value = eval("formStr." + field.name);

			if ($.type(value) != "undefined") {
				$("#"+field.name, $("#form")).val(value);
			}
		});
	};
</script>
<body>
<form id="form" name="form">
	<input id="abc" name="abc">
	<input id="abc_def" name="abc_def">
	<input id="abcDef" name="abcDef">
</form>
</body>
</html>